package com.ktjy.ktmall.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ktjy.common.annotation.Excel;
import com.ktjy.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;

/**
 * 商品信息对象 t_goods_info
 *
 * @author ktjy
 * @date 2025-01-13
 */
@Data
@TableName("t_goods_info")
public class GoodsInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 商品编号
     */
    @Excel(name = "商品编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 商品名称
     */
    @Excel(name = "商品名称")
    @TableField(value = "goods_name")
    private String goodsName;

    /**
     * 商品SPU
     */
    @Excel(name = "商品SPU")
    @TableField(value = "spu_code")
    private String spuCode;

    /**
     * 商品分类
     */
    @Excel(name = "商品分类")
    @TableField(value = "category_id")
    private Long categoryId;

    /**
     * 商品品牌
     */
    @Excel(name = "商品品牌")
    @TableField(value = "brand_id")
    private Long brandId;

    /**
     * 商品图片
     */
    @Excel(name = "商品图片")
    @TableField(value = "goods_img")
    private String goodsImg;

    /**
     * 商品描述
     */
    @TableField(value = "goods_desc")
    private String goodsDesc;

    /**
     * 商品价格
     */
    @Excel(name = "商品价格")
    @TableField(value = "goods_price")
    private BigDecimal goodsPrice;

    /**
     * 上架状态
     */
    @Excel(name = "上架状态")
    @TableField(value = "publish_status")
    private Long publishStatus;

    /**
     * 排序值
     */
    @TableField(value = "order_num")
    private Long orderNum;

    /**
     * 商品主图的图片地址，多个图片地址使用逗号隔开
     */
    @TableField(value = "mainPictures")
    private String mainPictures;

    /**
     * 商品详情的图片地址，多个图片地址使用逗号隔开
     */
    @TableField(value = "detailsPictures")
    private String detailsPictures;

    /**
     * 商品分类
     */
    @TableField(exist = false)
    private GoodsCategory goodsCategory;

    /**
     * 商品品牌
     */
    @TableField(exist = false)
    private Brand brand;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("goodsName", getGoodsName())
                .append("spuCode", getSpuCode())
                .append("categoryId", getCategoryId())
                .append("brandId", getBrandId())
                .append("goodsImg", getGoodsImg())
                .append("goodsDesc", getGoodsDesc())
                .append("goodsPrice", getGoodsPrice())
                .append("publishStatus", getPublishStatus())
                .append("orderNum", getOrderNum())
                .append("mainPictures", getMainPictures())
                .append("detailsPictures", getDetailsPictures())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("createBy", getCreateBy())
                .append("updateBy", getUpdateBy())
                .append("remark", getRemark())
                .toString();
    }
}